<%@ page pageEncoding="UTF-8"%>
<%@ include file="/common/token.jsp"%>
<%@ include file="/common/user.jsp"%>
<%@ include file="/common/operatehistory.jsp"%>
<%
	User self = userByUid(token.getUid());
	if (self == null || Tools.getDesc(self.getJson("role"), "1").equals("2")) {
		Tools.encryptPrint(out, new Message(30031, "您无权限进行该操作"));
		return;
	}
	List<String> secretarys = stringToList(input.getDesc("secretary_id"));
	QBuilder.db("basedb").execHQL("update OperateHistory set status=0 where uid='" + token.getUid() + "' and category=" + SECTION_SECRETARY + " and operate=" + ATTENTION);
	for (String secretary:secretarys) {
		User user = userByUid(Tools.getInt(secretary));
		if (isEmpty(user) || !Tools.getDesc(user.getJson("role")).equals("2")) {
			continue;
		}
		OperateHistory oh = OperateHistory.fromMap(parameters, OperateHistory.class);
		oh.setOid(secretary + "");	
		oh.setUid(token.getUid() + "");
		oh.setCategory(SECTION_SECRETARY);
		oh.setOperate(ATTENTION);
		operate(oh, false);
	}
	Tools.encryptPrint(out, msg);
%>
